<template>
  <div>
    <div>
      <el-button @click="httptest">测试axios</el-button>
      <el-button @click="testToken">测试vuex读取</el-button>
      <el-button @click="router">路由跳转</el-button>
    </div>

    <div>
      <el-input v-model="save"></el-input>
      <el-button @click="saveVuex">设置token</el-button>
    </div>

    <div>{{token}}</div>
    <div>{{ss}}</div>
    <el-image src="https://lius-1.oss-cn-qingdao.aliyuncs.com/test.jpg"></el-image>

  </div>
</template>

<script>
    import {mapGetters} from 'vuex'
    export default {
        name: "Test",
        data() {
            return {
                "ss" : "0",
                "token" : "1212121",
                "save" : ""
            }
        },
        computed:{
            ...mapGetters(['getToken'])
        },
        methods:{
            httptest(){
                this.$post({
                    url : "project/admin/list",
                    method : 'post',

                }).then(res => {
                    this.ss = res
                }).catch(err => {
                    console.log(err)
                })


            },
            testToken(){
                this.token = this.getToken
            },
            saveVuex(){
                this.$store.commit('setToken',this.save)
            },
            router(){
                this.$router.push({
                    path : "/"
                })
            }
        }
    }
</script>

<style scoped>

</style>
